package service;

import dao.UserDao;
import view.BookMenuView;
import view.MainView;

import java.util.Scanner;

/**
 * @Description TODO
 * @Author hhy
 * @Date 2020/9/17 10:37
 */
public class LoginService {
    public void login(){
        UserDao.admin(); //默认的用户
        Scanner sc = new Scanner(System.in);
        System.out.println("*********欢迎来到登录界面*******");
        System.out.println("请输入你的用户名");
        String username = sc.next();
        System.out.println("请输入你的密码");
        String password = sc.next();
        String status = UserDao.userLogin(username, password);
        if (status.equals("登录成功！")){
           new BookMenuView().view();
        }else {
            System.out.println("登录失败");
            new MainView().view();
        }

    }
}
